/*
 * Copyright 2005-2010 the original author or authors.
 * 
 *      http://www.derbysoft.com/
 *
 * Project demo
 */
package com.zhisheng.core.service;

import java.io.Serializable;
import java.util.List;

import com.zhisheng.core.page.Page;



/**
 * 
 */
public interface GenericService<T, ID extends Serializable> {

	
	<E> List<E> findAll(Class<E> c);

	T findById(ID id);
	
	T loadById(ID id);

    void save(Object entity);

	void update(Object entity);
	
	void saveOrUpdate(Object entity);
    
    void delete(T entity);

    Page findByPage(Page page, Class c);
    
    void batchDeleteEntities(String [] id);
    
    /**
	 * @param c
	 * @param roleIds
	 */
	void batchDeleteEntities(Class c, String[] ids);
	/**
	 * @param class1
	 * @param string
	 * @return
	 */
	<S> S findById(Class<S> class1, Serializable id);
	
}
